import request from '@/utils/request'
// 货取员工列表
export const getSimpleList = () => {
  return request({
    url: '/sys/user/simple',
    method: 'get'
  })
}

// 获取员工列表
export const getEmployeeList = (params) => {
  return request({
    url: '/sys/user',
    method: 'get',
    params
  })
}
// 新增员工
export const addEmployee = (data) => {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}
// 删除员工
export const delEmployee = (id) => {
  return request({
    url: `/sys/user/${id}`,
    method: 'delete'
  })
}
// 批量导入员工
export const batchEmployee = (data) => {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}

// 保存员工基本信息
export const updateEmployee = (data) => {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
}

// 给员工分配角色
export const assignRoles = (data) => {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data
  })
}
